Repository navigation
fix(plugin-grid): fold a row's inline primary action into its menu while the table overflows with it - #33441
Conversation
…ile the table overflows with them Claude-Session: https://claude.ai/code/session_01FEkQ5osPMA12JX9fGcBzR3 Co-Authored-By: Claude <noreply@anthropic.com>
…t data column in view Claude-Session: https://claude.ai/code/session_01FEkQ5osPMA12JX9fGcBzR3 Co-Authored-By: Claude <noreply@anthropic.com>
…he inline button Claude-Session: https://claude.ai/code/session_01FEkQ5osPMA12JX9fGcBzR3 Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5osPMA12JX9fGcBzR3 Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5osPMA12JX9fGcBzR3 Co-Authored-By: Claude <noreply@anthropic.com>
|
domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD 席位核对Verdict: ACCEPT · head
|
|
domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD Landing · head
State: ready + auto-merge. |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43645886119 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
…d link and no Open item (objectstack-ai#33544) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XEALUkWcYN7u2xZzujE7FCn)_ domain:ui#1 · os-project-manager · session_01FEkQ5pN9UhYM1KGHApVGCH Fixes objectstack-ai#33317 Clause-②: yes (widening) Metadata-protocol: none ## 维护者速读 - 改了什么:列表里点了不会打开任何东西的行(视图写了 `navigation.mode: 'none'`,或只开放 `list` 的对象),表格第一列不再画成链接(没有链接颜色、下划线、锚点或链接角色),右键菜单也不再出现「打开」和「在新标签页打开」;行操作(如 Revoke)照旧。对象列表、对象数据页、界面列表页三处都生效。 - 为什么改:这些行点了没有任何反应,但看起来可以点,用户会以为页面坏了。 - 风险与回滚:表格和列表视图各多一个可选的宿主属性 `rowOpensRecord`,不传时行为与之前完全一样,其他宿主不受影响;能打开记录的行(抽屉、页面)不变。回滚即 revert 本 PR。 - 先看:`ui/packages/plugin-grid/src/objectGridLinkCell.tsx` 的 `opens === false` 分支;`ui/packages/plugin-grid/src/ObjectGrid.tsx` 的 `renderRowContextMenu` 里 `rowOpensRecord` 两处;`ui/packages/app-shell/src/views/ObjectView.tsx` 的 `rowOpensRecord: navOverlay.mode !== 'none'`。 - 两分钟验证:`pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx packages/app-shell/src/views/InterfaceListPage.rowOpensNothing-33317.test.tsx`,预期 9 个用例全绿。 - 需要你做的:无,席位落地。 ## What changes **Measured on `origin/main` `f068cde8` (objectstack-ai#33441 included), through the real `ObjectView` → `ListView` → `ObjectGrid`.** The console hosts always hand `ListView` an `onRowClick`, and `ListView` always hands the grid `onRowClick: navigation.handleClick`, so the grid could not tell a row that opens nothing from one that opens a drawer. Two lines decided the face: - the record-link cell: `objectGridGenerateColumns.tsx` wraps the first column (and any `link: true` column) in `LinkCell` unconditionally, and `RecordLink` in `objectGridLinkCell.tsx` draws `a href` when the host publishes a record URL, else `span role="link"`. Measured: a view authored `navigation: { mode: 'none' }` on a served object draws the **anchor** (the host's `recordHref` answers); a list-only object draws the `span role="link"` with `data-testid="primary-field-link"` (its `recordHref` answers `null`). - the right-click Open: `renderRowContextMenu` in `ObjectGrid.tsx` reads `const opens = !!onRowClick || (navigation.mode !== 'none' && ...)`, so any host handler means Open. Measured: authored `none` offers `row-context-open` and `row-context-open-new-tab`; list-only offers `row-context-open`. The fix, the narrowest signal the order allowed: the grid cannot derive it from props it already receives (the console's resolved mode never reaches it; the grid branch of `ListView` forwards no `navigation`), so one optional prop carries it, absent = today's behaviour. - **`@object-ui/plugin-grid`**: `ObjectGridComponentProps.rowOpensRecord?: boolean`. `false` ⇒ `LinkCell` (new internal `opens` prop) draws the value in a plain `span` with the link's clamp and width only (no anchor, no `role`, no handler of its own, so its click falls through to the row), and `renderRowContextMenu` offers neither Open nor Open in new tab. Row actions, the actions column and objectstack-ai#33441's inline fold are untouched. - **`@object-ui/plugin-list`**: `ListViewProps.rowOpensRecord?: boolean`, forwarded to the grid only, on the grid's host channel beside `recordLinkAdornment` (only when defined). - **`@object-ui/app-shell`** (ships in `@object-ui/console`): `ObjectView` passes `navOverlay.mode !== 'none'` (the resolved mode: `none` for authored `none` and for a list-only object via `servesRecordRead`) through `useObjectViewListRenderer`; `ObjectDataPage` passes `recordServed`; `InterfaceListPage` passes `recordAction !== 'none'`. `onRowClick` is passed exactly as before. - **Docs**: `rowOpensRecord` sections in `ui/packages/plugin-grid/README.md`, `content/docs/frontend/plugins/plugin-grid.mdx` and `ui/packages/plugin-list/README.md`. - **Changeset** `.changeset/33317-row-opens-nothing-plain.md`: `@object-ui/plugin-grid`, `@object-ui/plugin-list`, `@object-ui/app-shell`, `@object-ui/console` patch, both declaration lines. Not changed: `packages/spec`, any server package, `onRowClick` routing, row actions. ## Tests `ui/packages/app-shell/src/views/ObjectView.rowOpensNothing-33317.test.tsx`, real `ObjectView` + `ListView` grid + `MePermissionsProvider`, one differential per case (same object and rows; only the view's `navigation` or the served operations differ). The right-click menu is opened by a `contextmenu` event on a plain cell. - authored `navigation.mode: none`: the name cell holds no `a[href]` and no `[role="link"]`, no `primary-field-link`; the menu has no Open items and keeps Revoke. - authored `none`: a ⌘-click on a plain cell still reaches the host (one `window.open`), and a ⌘-click on the now-plain name cell reaches the row too (a second one). - list-only object: same as the first case. - CONTROL, default drawer: the name cell is the record link, the menu offers Open and Open in new tab and Revoke. - CONTROL, authored `page`: the name cell is the link, the menu offers Open. - data page, list-only: the name cell is plain; CONTROL served: it is the link. `ui/packages/app-shell/src/views/InterfaceListPage.rowOpensNothing-33317.test.tsx`, real `InterfaceListPage` + `ListView` grid: `recordAction: 'none'` → plain name cell; CONTROL default drawer → link. **Red-first (the measurement):** the eight production files restored to base `f068cde8` (0 differ from base after restore), the new pins kept. <details><summary>base sources: 5 failed | 4 passed (9); restored: 0 bytes differ from HEAD</summary> ```text × `recordAction: none`: the name cell is plain text × authored `navigation.mode: none`: the name cell is plain text, and the right-click menu has no Open but keeps Revoke × authored `none` still hands the row click to the host: a ⌘-click on the row opens the record in a new tab, as before × a list-only object: the name cell is plain text, and the right-click menu has no Open but keeps Revoke × a list-only object: the name cell is plain text AssertionError: expected true to be false (x4: the name cell wears the link face) AssertionError: expected "vi.fn()" to be called 2 times, but got 1 times Test Files 2 failed (2) · Tests 5 failed | 4 passed (9) · VERDICT command-exit 1 ``` The ⌘-click case's first half (a plain cell, one `window.open`) passed on base: the host's row routing is unchanged; only the name cell's own anchor swallowed the second click. The CONTROL cases passed on both trees. </details> **Ablations** (`scripts/ablation-replace.mjs`, each anchor 1 → 0, restored to the HEAD blob with `git diff HEAD` empty; ui vitest aliases `@object-ui/*` to `src/`, so no dist is in the path): <details><summary>six legs, each red, each restored</summary> ```text A objectGridLinkCell.tsx `const own = opens === false` → `=== "ABL-A"` 4 failed | 3 passed (7) name cell wears the link face B1 ObjectGrid.tsx `const opens = rowOpensRecord !== false` → `!== ("ABL-B1" as unknown)` 2 failed | 5 passed (7) expected [ 'row-context-open' ] to deeply equal [] B2 ObjectGrid.tsx `const openHref = rowOpensRecord === false ? ...` → `=== ("ABL-B2" as unknown)` 1 failed | 6 passed (7) expected [ 'row-context-open-new-tab' ] to deeply equal [] (authored none only: a list-only row has no URL) C1 ObjectView.tsx `rowOpensRecord: navOverlay.mode !== 'none'` → `!== ('ABL-C1' as string)` 3 failed | 4 passed (7) C2 ObjectDataPage.tsx `rowOpensRecord={recordServed}` → `{recordServed || "ABL-C2".length > 0}` 1 failed | 6 passed (7) C3 InterfaceListPage.tsx `rowOpensRecord={recordAction !== 'none'}` → `!== ('ABL-C3' as string)` 1 failed | 1 passed (2) ``` </details> ## Acceptance notes - **Clause-② measured `yes (widening)`.** The order allowed a new optional prop when the grid cannot derive the signal; it needed one on `ObjectGrid` and one on `ListView` (the hop between the console and the grid), both published, both optional, absent = unchanged. The claim started at `no`; the seat amends it. - **File surface.** `ui/packages/plugin-list/src/ListView.tsx` (forwarding only) and three docs files are outside the claim's named files; they are the props that carry the signal to the grid, and the docs-driven rule in `ui/AGENTS.md` (Coding Standards, rule 2) asks for the README and docs page. - **⌘-click on an authored `none` row still opens a new tab.** That is `useNavigationOverlay`'s modifier-click rule ("regardless of the configured navigation mode"), reached through the host's `onRowClick`; the order says not to break what the host routes through it, so it stays, and the pin holds it. The menu's "Open in new tab" is gone for such a row, so the two now differ; a list-only row opens no tab either way. - **Other faces of the same rows, not changed here:** the phone card face (below 768 px) still draws the card as a tap target, and the gallery and board cards of a `none` list keep their pointer; only the grid is handed `rowOpensRecord`. Observed by reading, not measured; noted, not filed. - **`preventNavigation` on the console object list:** the console's `handleRowClick` writes `?recordId=` for a `drawer` view without reading `preventNavigation`, so `rowOpensRecord` is keyed to the resolved mode only. Observed by reading, not measured; noted, not filed. - **Lint:** `eslint` on the touched files: 0 errors; the `ListView` forwarding line adds one `react-hooks/refs` warning of the same shape its three sibling `viewComponentSchema.type === 'object-grid'` lines already carry. ## Verification Head `a02d289c` (`origin/main` `811b976a` merged in; no overlap with this diff). Local subset from `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`, reconciled with `--ran`: <details><summary>69 derived, 69 run, all exit 0; --ran: 0 NOT-MEASURED, 0 UNRUN</summary> ```text node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0 node scripts/check-adr-0087-registration.mjs --self-test :: exit 0 node scripts/check-adr-links.mjs :: exit 0 node scripts/check-adr-links.mjs --self-test :: exit 0 node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0 node scripts/check-closing-keyword-parity.mjs :: exit 0 node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0 node scripts/check-comment-mask-corpus.mjs :: exit 0 node scripts/check-doc-route-spelling.mjs --advisory :: exit 0 node scripts/check-doc-route-spelling.mjs --self-test :: exit 0 node scripts/check-docs-section-name.mjs :: exit 0 node scripts/check-docs-section-name.mjs --self-test :: exit 0 node scripts/check-empty-changeset.mjs --base origin/main :: exit 0 node scripts/check-empty-changeset.mjs --self-test :: exit 0 node scripts/check-sdui-manifest.mjs :: exit 0 node scripts/check-sdui-manifest.mjs --self-test :: exit 0 node scripts/check-section-landing-index.mjs :: exit 0 node scripts/check-section-landing-index.mjs --self-test :: exit 0 node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0 node scripts/ci/snapshot-next.mjs --self-test :: exit 0 node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0 node scripts/release-pending-publish.mjs --self-test :: exit 0 pnpm --dir ui exec vitest run scripts/ :: exit 0 pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0 pnpm --filter @objectstack/lint run check:doc-security-posture :: exit 0 pnpm --filter @objectstack/spec run check:docs :: exit 0 pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0 pnpm --filter @objectstack/spec run check:empty-state :: exit 0 pnpm --filter @objectstack/spec run check:liveness :: exit 0 pnpm --filter @objectstack/spec run check:skill-examples :: exit 0 pnpm --filter @objectstack/spec run check:strictness-ledger :: exit 0 pnpm --filter @objectstack/spec run check:variant-docs :: exit 0 pnpm --filter @objectstack/spec run check:yaml-examples :: exit 0 pnpm check:changeset-gate-self-tests :: exit 0 pnpm check:ci-filter-parity :: exit 0 pnpm check:closed-ceremony-text :: exit 0 pnpm check:corpus-claim-drift :: exit 0 pnpm check:cross-package-test-inputs :: exit 0 pnpm check:dispatcher-error-vocabulary :: exit 0 pnpm check:doc-anchors :: exit 0 pnpm check:doc-authoring :: exit 0 pnpm check:doc-frontmatter :: exit 0 pnpm check:docs-audit-scope :: exit 0 pnpm check:docs-redirects :: exit 0 pnpm check:docs-single-h1 :: exit 0 pnpm check:docs-spec-enumerations :: exit 0 pnpm check:docs-transcript-drift :: exit 0 pnpm check:driver-memory-census :: exit 0 pnpm check:engine-double-contract :: exit 0 pnpm check:error-status-conformance :: exit 0 pnpm check:gitlink-declared :: exit 0 pnpm check:nul-bytes :: exit 0 pnpm check:published-files :: exit 0 pnpm check:published-readme-links :: exit 0 pnpm check:query-options-erasure :: exit 0 pnpm check:react-page-adapter-contract :: exit 0 pnpm check:refd-timer-probe :: exit 0 pnpm check:registry-log-declared :: exit 0 pnpm check:rest-log-spy-declared :: exit 0 pnpm check:role-word :: exit 0 pnpm check:skill-identifier-liveness :: exit 0 pnpm check:test-source-alias :: exit 0 pnpm check:tier-file-adoption :: exit 0 pnpm check:type-check-coverage :: exit 0 pnpm check:type-check-debt :: exit 0 pnpm check:undeclared-dep-imports :: exit 0 pnpm check:vendor-version-stamps :: exit 0 pnpm check:watch-hint-literal :: exit 0 pnpm check:where-matcher :: exit 0 ``` </details> Also run locally, all exit 0 under the verify lock: `pnpm --filter @object-ui/plugin-grid run type-check`, `@object-ui/plugin-list` and `@object-ui/app-shell` (each `tsc --noEmit && tsc -p tsconfig.test.json`, so the new tests are type-checked); `pnpm --dir ui exec vitest run packages/plugin-grid/` → 281 files, 2436 passed; `packages/plugin-list/` → 173 files, 1856 passed; the app-shell `ObjectView*`, `objectView*`, `InterfaceListPage*` and `ObjectDataPage*` files → 111 files, 986 passed; the two new pin files plus `ObjectView.listOnlyRecordPage-33219` and `rowContextMenu-28434` on the final head → 4 files, 36 passed. `pnpm --dir ui check:new-line-citations` → 0 new. The full app-shell suite and every other family are CI's. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. (touched files linted, 0 errors; the repo-wide run is CI's) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. (the 维护者速读 section is the seat format) - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5pN9UhYM1KGHApVGCH)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Leehom · project thread
Fixes #33230
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
ObjectGridpins its Actions column to the right edge of the table's scroll box. Avariant: 'primary'row action draws as an inline button beside the row's "⋮" trigger, and that button roughly doubles the pinned column. In a record drawer's enlarged related list the content is 622 px wide at the default drawer size, and the extra width alone turns a table whose data columns fit into one that overflows. The pinned column then sits over the last data column (Status) at rest.The grid now draws inline row buttons only while the table fits its scroll box with them.
data-row-actions-inline="folded"while folded, so the state is readable in the DOM.No export, prop or authored key changes.
maxInlineRowActionsstays a non-author surface.Producer, measured on origin/main before the fix. It is the pinned column's width, not the scroll box's reservation. The box does reserve the column: its scroll width includes it, and scrolling to the end reveals Status. At rest, though, the 139 px column (with the inline button) covers the last data column, and
elementFromPointat the Status cell's centre answered the inline Allocate button (box 900 px, table 954 px, Status spanning 735 to 815 under the column from 761). Menu-only the column is 68 px.Tests
ui/e2e/related-list-pinned-actions-width.spec.tsmounts the realRelatedListenlarged face (thenobject-grid,data-tableand the row menu) in Chromium, with Vite-bundled sources and compiled Tailwind, inside a frame of the drawer's or the list page's width. Reachability is read from layout withelementFromPoint, and the menu path is driven with real clicks.Readings, at this head
Ablation at 3afff0c (the fold's decision made a no-op, through scripts/ablation-replace.mjs)
Acceptance notes
Verification
Head
ee03c81e. The gate list comes fromdispatch-gates --commandson this diff (37 families). Each exit code was captured before any pipe, then reconciled:dispatch-gates --ranreads 37 derived, 37 run, 0 NOT-MEASURED, 0 UNRUN, plus 4 ui runs outside the derivation. The workspace packages were built first (turbo run buildover./packages/*, exit 0).The first
uiscripts run went red on one test,e2e-type-check.test.ts"imports no workspace package". The pin's page entry named@object-ui/*packages in its source string. It now names their sources by path, and the whole suite reran green (171 files passed, 2 skipped). The gates that read the spec file reran after that change.Local gate record (COMMAND :: exit N)
CI families outside this list (the e2e chromium run that executes the new pin, the type-check lanes and the wide-population families) are read from this PR's check runs.
Generated by Claude Code